Skip to content

knowledge: 12 insights — deny rules under bypass, merged-tree gate, worker verify command, Kotlin daemon heap, extracted-method this (+7 merges) - #179

Open
choiyounggi wants to merge 5 commits into
mainfrom
knowledge/choiyounggi-20260903-172728
Open

knowledge: 12 insights — deny rules under bypass, merged-tree gate, worker verify command, Kotlin daemon heap, extracted-method this (+7 merges)#179
choiyounggi wants to merge 5 commits into
mainfrom
knowledge/choiyounggi-20260903-172728

Conversation

@choiyounggi

Copy link
Copy Markdown
Owner

Knowledge flush — 12 insight(s)

Batch: 12 of 109 pending candidates were claimed (queue-claim.js claim --max 12) so the PR stays reviewable; the remaining 97 stay pending for later flushes. Every claimed row was handled (none released): 5 new pages, 7 merges into existing pages, 0 dropped. Each claim was researched by a dedicated verifier agent against live-fetched primary sources and, where possible, reproduced locally; two candidate details were found wrong and corrected in the pages (noted below).

Verified best-practice

# Candidate (hash) Claim Sources checked (fetched/read) How verified Confidence
1 2002a817b2e74f84 A quantifier after a non-ASCII literal binds to the last UTF-8 byte under LC_ALL=C; group it (─){3,} and test under C POSIX grep spec (already cited on the page); bug-grep list thread on unibyte vs multibyte code paths Reproduced on macOS BSD grep 2.6.0-FreeBSD and BSD sed: ─{3,} → 0 under C, 1 under UTF-8; (─){3,} → 1 in both; a + two bare 0x80 bytes matches ─{3,} under C (last-byte binding). GNU grep not installed → GNU result stated as untested verified (BSD); GNU untested, said so on the page
2 6b8811c6c3b0f983 permissions.deny is enforced in bypassPermissions; deny wins at every level; compound commands split per subcommand; wrappers stripped https://code.claude.com/docs/en/permission-modes ("Deny rules block in every mode, including bypassPermissions … Allow rules have no effect in bypassPermissions"); https://code.claude.com/docs/en/permissions (deny-at-any-level, separator list, stripped-wrapper list) Direct quotes. Correction: the candidate listed env among stripped wrappers; the docs' list is timeout, time, nice, nohup, stdbuf, command, builtin, noglob plus a leading VAR=valueenv is not stripped. Page says so verified
3 a9ebd8fda72aade6 Slow Kotlin build + Exception during IR lowering → suspect heap; raise Gradle + Kotlin daemon heap at user level https://docs.gradle.org/current/userguide/build_environment.html (user-level precedence quote); https://kotlinlang.org/docs/gradle-compilation-and-caches.html (kotlin.daemon.jvmargs vs -Dkotlin.daemon.jvm.options, inheritance); https://kotlinlang.org/docs/kotlin-daemon.html (inherits -Xmx) Docs fetched and the property keys re-grepped from the raw HTML by me. Correction: the candidate's kotlin.daemon.jvm.options=-Xmx4g line is a system property valid only inside org.gradle.jvmargs; the Gradle key is kotlin.daemon.jvmargs. The symptom→heap link has no external source (documented causes of that message are compiler bugs), only the session's one measured build (19 min fail at 1g → 4m13s pass at 4g) field-tested; page keeps the compiler-defect hypothesis explicit
4 44cd212b53946b62 Bash-hook guard misses Write/Edit escapes; on escalation check main git status, transfer by patch (diffapply --check/applycheckout --) https://code.claude.com/docs/en/hooks (matcher Edit|Write, exit-2 block); https://git-scm.com/docs/git-worktree; https://git-scm.com/docs/git-apply (--check quote) Mechanics doc-confirmed; the recovery recipe is the session's field reproduction (lo-2 files transferred, main restored, MAIN_CLEAN). Merged into a page already verified verified page, field-tested addition
5 2e3d108012a7e164 Unbound method extraction loses this; bind at extraction; a vi.fn() test cannot catch it https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this; https://vitest.dev/api/mock.html node -e repro: unbound → TypeError: Cannot read properties of undefined; bound → 42. Correction: Vitest's mock.contexts records this per call, so a vi.fn() test can catch it when it asserts mock.contexts[0] === obj; page offers that as the third test shape verified
6 28897d4a24a46ae9 Parallel branches green alone can fail on merge (E0004); build+test the merged tree before dispatching dependents https://martinfowler.com/bliki/SemanticConflict.html; https://git-scm.com/docs/git-merge; https://doc.rust-lang.org/error_codes/E0004.html Quotes: "safely merged on a textual level but cause the program to behave differently"; git merge documented as textual 3-way only; E0004 non-exhaustive patterns. Field run slk1 as the reproduction verified
7 f978fd126f72956f Write the interpreter by path in worker briefs; measure and record the baseline Ran N / failures=M first https://docs.python.org/3/library/venv.html ("You don't specifically need to activate…"); https://docs.python.org/3/library/unittest.html Docs quoted; Ran 3 tests … FAILED (failures=1, errors=1) reproduced locally; field measurement 3532/15+18 vs 3549/1 verified (baseline-recording half is process advice grounded in completion-claims)
8 076309143096ed63 A substring doc-coverage gate is vacuous; scope to heading lines with word boundaries; falsify against a known-bad revision https://testing.googleblog.com/2020/08/code-coverage-best-practices.html ("Mutation testing can help detect such false coverage"); the page's existing mutation-testing and RuleTester sources Source fetched; field reproduction (commit 7bdbb1c: pre-fix doc → missing: ['grammar']) verified sources, merged into a field-tested page
9 5d4a63ae21e06d9e After an auditor reports mutation testing on your uncommitted tree, diff against a pre-audit patch and re-run the suite yourself https://git-scm.com/docs/git-checkout (checkout -- <path> discards unstaged changes); https://pitest.org/quickstart/basic_concepts/; repo's own agents/test-quality-auditor.md (restore mechanism) Docs quoted; repo file read; wiki's own caveat (untracked file diffs clean either way) supports the independent check. The "session must verify independently" step is the session's practice, not an external norm field-tested
10 d3d8fdcc202b8760 tmux ls sees one server only; before resuming as coordinator, prove no live coordinator via ps + artifact mtimes man tmux (list-sessions scoped to a server; -L/-S); man ps (-A, -o lstart,command); repo skills/orchestrate/SKILL.md re-entry section Man pages read; nuance added: a missing watcher process alone proves nothing (coordinator between polls), only presence proves liveness — page states both-absences rule. Field run: PID 54780 alive on ssh pty, duplicate commits on t3 field-tested (man-page facts verified)
11 87d2a59d6b82953c argparse required=True accepts ""; realpath("") is the CWD; reject empty before resolving https://docs.python.org/3/library/argparse.html#required; https://docs.python.org/3/library/os.path.html#os.path.abspath Quotes; local repro parse_args(["--out",""])Namespace(out=''), realpath('') → cwd verified
12 f301809d865f8865 Guard bats suite inside a worker floods the run's escalation dir and reads the worktree's sandbox config via upward traversal; override the env + run from a clean cwd https://bats-core.readthedocs.io/en/stable/writing-tests.html (bats-run-* naming); repo skills/orchestrate/scripts/{escalation-dir,worker-guardrails,watch-status}.sh; guard source groundwork/plugins/guardrails/hooks/bash-guard.sh + its bats tests (the two named tests do not cd into their tmpdir) Mechanism confirmed by reading the real scripts; the 175-record count is the session's observation field-tested

Existing-layer check

Routing went through INDEX.md, then the domain indexes for infrastructure, backend (+ java, python, node subtrees), frontend, testing, platforms, qa, debugging, and the security agent-exposure section; every page whose "load when" overlapped a candidate was opened in full.

Pages read: platforms-environment-unicode-text-matching, platforms-shells-escapes-in-shell-string-literals, platforms-environment-timezone-and-locale, platforms-tools-agent-permission-classifier-denials, infrastructure-agent-orchestration-worktree-isolated-workers, qa-process-scope-purity-checks, backend-java-runtime-threads-and-memory, testing-mocking-what-to-mock, testing-quality-tests-that-cannot-fail, infrastructure-agent-orchestration-shared-run-state, backend-common-change-impact-cross-module-consumer-census, infrastructure-agent-orchestration-autonomous-decision-rulings, platforms-environment-path-resolution, platforms-toolchains-version-management, qa-process-completion-claims, testing-quality-spec-artifact-checks, qa-document-verification-spec-document-gates, testing-quality-checks-that-cannot-pass, testing-quality-harness-reverse-controls, testing-quality-mutation-harness-file-custody, infrastructure-agent-orchestration-control-signals-vs-primary-artifacts, infrastructure-config-path-valued-config, backend-python-boundaries-runtime-validation, testing-data-test-data-and-isolation, testing-data-artifact-leakage-from-a-suite

Per candidate:

# Overlap found Decision
1 unicode-text-matching already has a generic "quantifier over non-ASCII → test on both userlands" row Merged into it: +1 edge row (last-byte binding under C, grouping fix), +1 Instead-of row, +2 sources; related +bsd-vs-gnu-cli both ways
2 agent-permission-classifier-denials has the deny tier in its precedence table but is scoped to auto-mode classifier denials; worktree-isolated-workers covers path isolation, not command classes New page platforms/tools/deny-rules-under-bypassed-permissions; links both ways with classifier-denials, worktree-isolated-workers, control-signals, binding-instructions, checks-that-cannot-pass
3 threads-and-memory covers runtime heap diagnosis, not the build daemons; no Gradle/Kotlin-compiler page exists New page backend/java/kotlin/compiler-daemon-heap-pressure; links both ways with threads-and-memory, reading-error-messages, hypothesis-testing
4 worktree-isolated-workers already carries the Bash-hook-vs-Edit/Write edge row and Instead-of row Merged: +1 edge row (escalation-time main-tree check + patch transfer, complete hook matcher), +1 Instead-of row, +git-apply source, +field reproduction. No conflict with the existing directive — it extends it
5 what-to-mock and tests-that-cannot-fail cover mock-hides-bug generally; nothing on this binding New page testing/mocking/extracted-method-this-binding; links both ways with what-to-mock, tests-that-cannot-fail, captured-call-arguments, test-level-choice
6 shared-run-state (default branch moved), cross-module-consumer-census (integration-time census), widening-a-closed-value-table (enum/table widening) are adjacent; none covers the post-merge build gate New page infrastructure/agent-orchestration/semantic-conflicts-after-parallel-merge; links both ways with those three, autonomous-decision-rulings, worktree-isolated-workers, completion-claims
7 path-resolution (pin binaries in automation), version-management (shims absent non-interactively), completion-claims (dropped total = red) each hold one third New page infrastructure/agent-orchestration/verify-command-in-a-worker-brief composing them for the brief-authoring trigger; links both ways with all three, compiler-sysroot-on-macos, tests-that-cannot-fail, worktree-isolated-workers
8 spec-document-gates axis table ("token survives in a nearby paragraph"), spec-artifact-checks (negative control per check), checks-that-cannot-pass (known-good/known-bad) already own the principle Merged into spec-document-gates: +1 edge row (heading-scoped word-boundary match + pre-fix revision as negative control), +1 Instead-of row, +2 sources. Near-duplicate; the heading/word-boundary scoping and revision-as-mutant detail were the only additions
9 tests-that-cannot-fail (restore mechanism by commit state; multi-agent shared tree), mutation-harness-file-custody (untracked file diffs clean either way), completion-claims (relaying subagent reports) Merged into completion-claims claim/evidence table (+1 row, +git-checkout source, +field reproduction); related +mutation-harness-file-custody both ways. Not added to tests-that-cannot-fail (115 body lines, near the cap)
10 shared-run-state step 3 confirms a foreign run from the repo; autonomous-decision-rulings step 3 re-reads the ledger on resume Merged into shared-run-state: +1 edge row (coordinator liveness on resume: tmux-server scope, ps, artifact mtimes, both-absences rule), +1 Instead-of row, +man ps citation, +field reproduction
11 path-valued-config already rejects non-absolute paths (an empty string is non-absolute) and lists rejection test inputs Merged: When-this-applies widened to required CLI flags, "" added to the rejection test set, +1 edge row (argparse presence-only, realpath("") = CWD), +1 Instead-of row, +3 sources
12 test-data-and-isolation already has two rows on harness-injected env vars and "the code under test is the harness that spawned the session" (issue #100, same shape) Merged (delta only): +1 edge row (cwd-walking config discovery + override the exported escalation dir), +bats source, +field reproduction; coordinator-side cleanup row added to shared-run-state

Conflicts flagged: none — every merge extends an existing directive; no existing directive was contradicted or overwritten.

Open-PR check

gh pr list --repo choiyounggi/dev-loop --state open --json number,headRefName,title --search "head:knowledge/"

returned no rows, and gh pr list --state open --limit 50 (any head) also returned no rows at flush time (2026-09-03 17:28 KST, as choiyounggi). No sibling knowledge branch exists, so no candidate could fold into or duplicate an in-flight PR.

Per-candidate verdict: all 12 → new (no overlapping open head).

Routing decision

# Target Category fit
1 platforms/environment/unicode-text-matching (merge) existing
2 platforms/tools/deny-rules-under-bypassed-permissions (new page) tools already holds Claude Code harness pages (classifier denials, plugin MCP registration, version-keyed cache); no new category
3 backend/java/kotlin/compiler-daemon-heap-pressure (new page) kotlin is the Kotlin-only subtree category; the Kotlin compile daemon is Kotlin-only; no new category
4 infrastructure/agent-orchestration/worktree-isolated-workers (merge) existing
5 testing/mocking/extracted-method-this-binding (new page) the changed artifact is the test's mock choice → mocking; frontend has no language-mechanics category and the lesson is not React-specific
6 infrastructure/agent-orchestration/semantic-conflicts-after-parallel-merge (new page) the coordinator's integration step owns the merged tree → agent-orchestration
7 infrastructure/agent-orchestration/verify-command-in-a-worker-brief (new page) brief authoring is agent-orchestration (same category as worktree-isolated-workers' brief rules)
8 qa/document-verification/spec-document-gates (merge) existing
9 qa/process/completion-claims (merge) existing
10 infrastructure/agent-orchestration/shared-run-state (merge) existing
11 infrastructure/config/path-valued-config (merge) existing
12 testing/data/test-data-and-isolation (merge) + shared-run-state (coordinator side) existing

No new category was needed. Indexes updated: wiki/platforms/index.md, wiki/infrastructure/index.md, wiki/backend/java/index.md, wiki/testing/index.md, wiki/qa/index.md, root INDEX.md (infrastructure and platforms route lines); log.md appended.

Checks run before the PR: node scripts/wiki-lint-prohibitions.js wiki, node scripts/wiki-structure-checks.js wiki, body-line counts of every touched page (≤120), and a resolver over every related: id, inline [id] reference, and page-to-index listing (results in the PR conversation).

5 new pages, 7 amended pages, 5 domain indexes + root INDEX updated.
New: platforms/tools/deny-rules-under-bypassed-permissions,
infrastructure/agent-orchestration/semantic-conflicts-after-parallel-merge,
infrastructure/agent-orchestration/verify-command-in-a-worker-brief,
backend/java/kotlin/compiler-daemon-heap-pressure,
testing/mocking/extracted-method-this-binding.
Amended: unicode-text-matching, worktree-isolated-workers,
spec-document-gates, path-valued-config, completion-claims,
shared-run-state, test-data-and-isolation.
See .dev-loop/INGEST_REPORT.md for sources, dedup and routing.
…kers (pre-write escape deny + --git-common-dir mechanism)
@choiyounggi

Copy link
Copy Markdown
Owner Author

Folded one candidate from the 2026-09-03 18:46 flush (PR #180) into this branch instead of opening a sibling edit: worktree-isolated-workers gains Do-this step 7 (state dirs named worktree-relative; --git-common-dir vs --show-toplevel mechanism), a pre-write worktree_escape deny + relative-path edge-case row, an Instead-of row, and two source lines. Disjoint from this PR's post-hoc patch-transfer row. Lint: 0 violations, 0 structure findings.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Wiki agent gate: fail

PR #179 touches wiki/** (5 new pages, 7 merges, index/log updates). Transferability check: clean — all five new pages teach a general, externally-verifiable directive; private-repo field evidence (linkly, dev-loop, groundwork, rtb-unified-style names) is used only as evidence, not as the directive's subject, and "groundwork" is elsewhere noted in this wiki as a public repository. Duplication check: clean — an independent search of the existing wiki (via subagent, cross-checked by me) found no directive that is a full pre-existing duplicate; the two cases with partial conceptual overlap (deny-rules-under-bypassed-permissions vs. agent-permission-classifier-denials; verify-command-in-a-worker-brief vs. path-resolution/version-management) are already cross-linked both ways via related:, so neither triggers the advisory rule. Fact check: 18 of 19 newly-cited external quotes were WebFetched and confirmed accurate (I independently re-fetched the 19th myself to verify). One blocker: a source citation on wiki/qa/document-verification/spec-document-gates.md attributes a sentence to the Google Testing Blog article body when it is actually a reader's comment on that page, not the article's own content.

  • blocker [fact] wiki/qa/document-verification/spec-document-gates.md — The Sources entry "https://testing.googleblog.com/2020/08/code-coverage-best-practices.html — ... 'Mutation testing can help detect such false coverage' — the same presence-versus-verification gap a substring gate has" cites that sentence as if it were the article's own content. I fetched the page directly: the sentence is not in the Google-authored article body — it appears only in a reader comment posted by a commenter ("Дмитрий", Oct 2020) responding to another reader. Citing a blog comment as if it were the article misrepresents the source's authority for a claim this page uses to justify adding mutation testing as a coverage-gate remedy. Fix: either drop the citation and rely on the page's own field reproduction (commit 7bdbb1c) plus the already-cited https://testing.googleblog.com/2021/04/mutation-testing.html source (already in this page's frontmatter sources: list and directly on-topic), or explicitly attribute the quote as a reader comment rather than the article.

@choiyounggi

Copy link
Copy Markdown
Owner Author

Fold from the 2026-09-03 20:38 flush (queue hash 3e979f78): pushed 84eefc9 — extends the worktree_escape recovery row in worktree-isolated-workers with "stop the escaping worker before lifting the patch" and mtime-based attribution when several workers are in flight, adds an edge-case row for the symptom "an unrelated test fails right after a merge / the integration branch in main is dirty" (escaped edits ride into the next merge commit as another task's work), plus the linkly t112 field evidence (11 misattributed failures cleared). Candidate retired as folded; no sibling PR opened.

…-routed edits into worktree-isolated-workers
@choiyounggi

Copy link
Copy Markdown
Owner Author

Folded two queued candidates from flush run 20260903-213946-4161 into this branch (commit e242b2c) instead of opening a sibling PR:

  • verify-command-in-a-worker-brief: edge-case + instead-of rows — a task whose deliverable is a numbered/spec document in a repo with README-count / generated-reference currency gates names those gate tests on its own verify line (field evidence: linkly run enf0829, 10 integration failures from one missing RFC_ROUTES["0043"] entry).
  • worktree-isolated-workers: instead-of row — when the Bash-only guard matcher cannot be widened, route worker edits through Bash with worktree-relative paths and post-check main with git status --porcelain (field evidence: linkly 2026-08-26, three Edit-tool writes passed silently while a Bash diff tripped the guard).

Index load-when cell for verify-command updated; log.md appended; wiki-structure-checks and wiki-lint-prohibitions both clean on the branch.

…d stale install/codegen re-sync into worktree-isolated-workers + semantic-conflicts-after-parallel-merge
@choiyounggi

Copy link
Copy Markdown
Owner Author

Fold from flush 20260906-003715-45485 (commit dc92dad): two queue candidates overlapped this PR's pages, so they were added here instead of as a sibling PR.

  • worktree-isolated-workers: new edge-case row — a worker's done signal with a clean worktree, or a worker reporting "unexplained external git resets", is the Edit/Write escape you already document; recover with git diff in main → git apply --3way in the worktree (field: run i168 t2, bats 21/21 after transplant). Source bullet for git apply extended with --3way.
  • semantic-conflicts-after-parallel-merge: new merged-tree-result row + Instead-of row — Cannot find module / undefined generated model right after the merge means the integration worktree's node_modules and codegen predate the merge; pnpm install + prisma generate before reading it as a regression (field: trip3, 7 suites + 2 e2e fixed with no code change). Sources: pnpm.io/cli/install, Prisma generating-prisma-client.

Lint on this branch: structure 0 findings, prohibitions 0 violations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-loop:knowledge Auto-opened wiki knowledge ingest PR (owner reviews & merges)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant